package ai.plantdata.Structural.mode.Wrapper.test;

import ai.plantdata.Structural.mode.Wrapper.abstracts.ShapeDecorator;
import ai.plantdata.Structural.mode.Wrapper.abstracts.impl.RedShapeDecorator;
import ai.plantdata.Structural.mode.Wrapper.interfaces.Shape;
import ai.plantdata.Structural.mode.Wrapper.interfaces.impl.Circle;
import ai.plantdata.Structural.mode.Wrapper.interfaces.impl.Rectangle;

/**
 * @Author: WangHui
 * @Date: 2020/12/21 14:07
 * @Description:
 */
public class DecoratorPatternDemo {
    public static void main(String[] args) {

        Shape circle = new Circle();
        ShapeDecorator redCircle = new RedShapeDecorator(new Circle());
        ShapeDecorator redRectangle = new RedShapeDecorator(new Rectangle());
        //Shape redCircle = new RedShapeDecorator(new Circle());
        //Shape redRectangle = new RedShapeDecorator(new Rectangle());
        System.out.println("Circle with normal border");
        circle.draw();

        System.out.println("\nCircle of red border");
        redCircle.draw();

        System.out.println("\nRectangle of red border");
        redRectangle.draw();
    }
}